#ifndef _PRINCIPAL_HPP
#define _PRINCIPAL_HPP 1

#include <stdint.h>
#include <string>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>

namespace BFT
{
	namespace membership
	{
		class Principal
		{
		
			public:
			
			Principal(); //dummy constructor
			
			Principal(in_addr_t _addr, uint16_t _port, std::string _pubKeyString);
			
			Principal(in_addr_t _addr, uint16_t _port, std::string _pubKeyString, void* _macKey);
			
			Principal(std::string _string, std::string _pubKeyString);
			
			std::string getPubKeyString();
			
			void getPublicKey();
			
			in_addr_t getAddr();
			
			uint16_t getPort();
			
			void getMacKey();
			
			void setMacKey(); 
			
			void printInfo();
		
			protected:
			
			std::string pubKeyString; 
			uint16_t uint_port; // port number, still in host endianness!!!!
			in_addr_t address; 
						
		};
		
		inline std::string Principal::getPubKeyString() {return pubKeyString;}
		
		inline in_addr_t Principal::getAddr() {return address;}
		
		inline uint16_t Principal::getPort() {return uint_port;} // returns the port number in host endianness!!!		
	} //namespace membership
} //namespace BFT


#endif
